package com.xs.designpattern;

import lombok.extern.slf4j.Slf4j;

/**
 * @author xs
 */
@Slf4j
public class Main {
    public static void main(String[] args) {
        HeroFactoryImpl factory =
            new HeroFactoryImpl(new ElfMage("煮饭"), new ElfWarlord("打扫"), new ElfBeast("捕猎"));
        Mage mage = factory.createMage();
        Warlord warlord = factory.createWarlord();
        Beast beast = factory.createBeast();
        log.info(mage.toString());
        log.info(warlord.toString());
        log.info(beast.toString());

        factory = new HeroFactoryImpl(new OrcMage("法杖"), new OrcWarlord("大炮"), new OrcBeast("斧头"));
        mage = factory.createMage();
        warlord = factory.createWarlord();
        beast = factory.createBeast();
        log.info(mage.toString());
        log.info(warlord.toString());
        log.info(beast.toString());
    }
}